<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>正方体</title>

    <style>
        *{
            padding: 0;
            margin: 0;
        }

        li{
            list-style: none;
        }

        .cube{
            position: relative;
            width: 100px;
            height: 100px;
            border: 1px solid #000;
            margin: 200px auto;
            transform: rotateX(0deg) rotateY(0deg);
            transform-style: preserve-3d;
        }

        ul.cube li{
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            line-height: 100px;
            text-align: center;
        }

        .cube li:nth-child(1){
            background-color: #ffff00;
            transform: translate(-50px) rotateY(90deg);
        }
        .cube li:nth-child(2){
            background-color: #ff00ff;
            transform: translate(50px) rotateY(90deg);
        }
        .cube li:nth-child(3){
            background-color: #00ffff;
            transform: translateY(50px) rotateX(90deg);
        }
        .cube li:nth-child(4){
            background-color: #80ff00;
            transform: translateY(-50px) rotateX(90deg);
        }
        .cube li:nth-child(5){
            background-color: #fff8ff;
            transform: translateZ(50px);
        }
        .cube li:nth-child(6){
            background-color: #4400ff;
            transform: translateZ(-50px);
        }
    </style>
</head>
<body>

    <ul class="cube">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
    </ul>
    
</body>
</html>
